.class public Les/z70;
.super Ljava/lang/Object;
.source "ArchiveFactory.java"


# static fields
.field public static final a:Lorg/apache/commons/compress/archivers/zip/ZipLong;

.field static final b:[B


# direct methods
.method static constructor <clinit>()V
    .locals 3

    .line 1
    new-instance v0, Lorg/apache/commons/compress/archivers/zip/ZipLong;

    const-wide/32 v1, 0x2014b50    # 1.6619997E-316

    invoke-direct {v0, v1, v2}, Lorg/apache/commons/compress/archivers/zip/ZipLong;-><init>(J)V

    .line 2
    new-instance v0, Lorg/apache/commons/compress/archivers/zip/ZipLong;

    const-wide/32 v1, 0x4034b50

    invoke-direct {v0, v1, v2}, Lorg/apache/commons/compress/archivers/zip/ZipLong;-><init>(J)V

    sput-object v0, Les/z70;->a:Lorg/apache/commons/compress/archivers/zip/ZipLong;

    const-wide/32 v0, 0x6054b50

    .line 3
    invoke-static {v0, v1}, Lorg/apache/commons/compress/archivers/zip/ZipLong;->getBytes(J)[B

    move-result-object v0

    sput-object v0, Les/z70;->b:[B

    return-void
.end method

.method public static a(Ljava/lang/String;Ljava/lang/String;I)Les/b80;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;,
            Lcom/estrongs/fs/FileSystemException;
        }
    .end annotation

    .line 1
    sget-object v0, Les/c80;->a:Ljava/lang/String;

    invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 2
    new-instance p1, Les/i80;

    new-instance v0, Ljava/io/BufferedOutputStream;

    invoke-static {p0}, Lcom/estrongs/fs/impl/local/f;->g(Ljava/lang/String;)Ljava/io/OutputStream;

    move-result-object p0

    invoke-direct {v0, p0}, Ljava/io/BufferedOutputStream;-><init>(Ljava/io/OutputStream;)V

    invoke-direct {p1, v0, p2}, Les/i80;-><init>(Ljava/io/OutputStream;I)V

    return-object p1

    .line 3
    :cond_0
    sget-object p2, Les/c80;->b:Ljava/lang/String;

    invoke-virtual {p2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p2

    if-nez p2, :cond_2

    sget-object p2, Les/c80;->c:Ljava/lang/String;

    invoke-virtual {p2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p1

    if-eqz p1, :cond_1

    goto :goto_0

    :cond_1
    const/4 p0, 0x0

    return-object p0

    .line 4
    :cond_2
    :goto_0
    new-instance p1, Les/h80;

    invoke-direct {p1, p0}, Les/h80;-><init>(Ljava/lang/String;)V

    return-object p1
.end method

.method public static a(Ljava/lang/String;Ljava/util/Map;)Les/b80;
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;)",
            "Les/b80;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;,
            Lcom/estrongs/fs/FileSystemException;
        }
    .end annotation

    const-string v0, "archive_type"

    .line 5
    invoke-interface {p1, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    const-string v1, "compress_level"

    .line 6
    invoke-interface {p1, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Ljava/lang/String;

    invoke-static {p1}, Lcom/estrongs/android/util/o0;->c(Ljava/lang/String;)I

    move-result p1

    .line 7
    invoke-static {p0, v0, p1}, Les/z70;->a(Ljava/lang/String;Ljava/lang/String;I)Les/b80;

    move-result-object p0

    return-object p0
.end method

.method public static a(Ljava/lang/String;Ljava/lang/String;Z)Les/e80;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const/4 v0, 0x0

    .line 8
    invoke-static {p0, p1, p2, v0}, Les/z70;->a(Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;)Les/e80;

    move-result-object p0

    return-object p0
.end method

.method public static a(Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;)Les/e80;
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const-string v0, "file://"

    .line 9
    invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 10
    invoke-static {p0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object p0

    invoke-virtual {p0}, Landroid/net/Uri;->getPath()Ljava/lang/String;

    move-result-object p0

    :cond_0
    const/4 v0, 0x0

    if-nez p2, :cond_1

    .line 11
    invoke-static {p0}, Les/x70;->a(Ljava/lang/String;)Les/e80;

    move-result-object p2

    if-eqz p2, :cond_2

    return-object p2

    :cond_1
    move-object p2, v0

    :cond_2
    if-eqz p3, :cond_3

    .line 12
    sget-object v1, Les/c80;->d:Ljava/lang/String;

    invoke-virtual {v1, p3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p3

    if-eqz p3, :cond_3

    .line 13
    new-instance p2, Lcom/estrongs/io/archive/sevenzip/d;

    invoke-direct {p2, p0, p1}, Lcom/estrongs/io/archive/sevenzip/d;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    return-object p2

    .line 14
    :cond_3
    invoke-static {p0}, Lcom/estrongs/android/util/n0;->U(Ljava/lang/String;)Z

    move-result p3

    if-eqz p3, :cond_5

    .line 15
    invoke-static {p0}, Les/z70;->b(Ljava/lang/String;)Z

    move-result p2

    if-eqz p2, :cond_4

    .line 16
    invoke-static {p0}, Les/z70;->a(Ljava/lang/String;)V

    .line 17
    new-instance p2, Lcom/estrongs/io/archive/aeszip/b;

    invoke-direct {p2, p0, p1}, Lcom/estrongs/io/archive/aeszip/b;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0

    .line 18
    :cond_4
    new-instance p0, Ljava/io/IOException;

    const-string p1, "Bad zip file."

    invoke-direct {p0, p1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw p0

    .line 19
    :cond_5
    invoke-virtual {p0}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object p3

    const-string v1, ".gz"

    invoke-virtual {p3, v1}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result p3

    if-eqz p3, :cond_6

    .line 20
    new-instance p2, Les/g80;

    invoke-direct {p2, p0}, Les/g80;-><init>(Ljava/lang/String;)V

    goto :goto_0

    .line 21
    :cond_6
    invoke-virtual {p0}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object p3

    const-string v1, ".rar"

    invoke-virtual {p3, v1}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result p3

    if-eqz p3, :cond_8

    .line 22
    new-instance p2, Lcom/estrongs/io/archive/sevenzip/a$b;

    const-string p3, "AUTO"

    invoke-direct {p2, p0, p3, v0}, Lcom/estrongs/io/archive/sevenzip/a$b;-><init>(Ljava/lang/String;Ljava/lang/String;Lcom/estrongs/io/archive/sevenzip/a$d;)V

    invoke-virtual {p2}, Lcom/estrongs/io/archive/sevenzip/a$b;->e()Z

    move-result p2

    if-eqz p2, :cond_7

    .line 23
    new-instance p2, Lcom/estrongs/io/archive/sevenzip/d;

    invoke-direct {p2, p0, p1}, Lcom/estrongs/io/archive/sevenzip/d;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0

    .line 24
    :cond_7
    new-instance p2, Lcom/estrongs/io/archive/rar/a;

    invoke-direct {p2, p0, p1}, Lcom/estrongs/io/archive/rar/a;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 25
    invoke-virtual {p2}, Lcom/estrongs/io/archive/rar/a;->m()Z

    move-result p3

    if-nez p3, :cond_9

    .line 26
    new-instance p2, Lcom/estrongs/io/archive/sevenzip/d;

    invoke-direct {p2, p0, p1}, Lcom/estrongs/io/archive/sevenzip/d;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0

    .line 27
    :cond_8
    invoke-static {p0}, Lcom/estrongs/android/util/n0;->e(Ljava/lang/String;)Z

    move-result p3

    if-eqz p3, :cond_9

    .line 28
    new-instance p2, Lcom/estrongs/io/archive/sevenzip/d;

    invoke-direct {p2, p0, p1}, Lcom/estrongs/io/archive/sevenzip/d;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    :cond_9
    :goto_0
    return-object p2
.end method

.method public static a(Ljava/lang/String;Ljava/util/Map;Ljava/lang/String;)Les/e80;
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;",
            "Ljava/lang/String;",
            ")",
            "Les/e80;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const-string v0, "reload"

    .line 29
    invoke-interface {p1, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    const-string v1, "true"

    invoke-virtual {v1, v0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    const-string v1, "charset_name"

    .line 30
    invoke-interface {p1, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Ljava/lang/String;

    .line 31
    invoke-static {p0, p1, v0, p2}, Les/z70;->a(Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;)Les/e80;

    move-result-object p0

    if-eqz p0, :cond_0

    :cond_0
    return-object p0
.end method

.method public static a(Ljava/lang/String;)V
    .locals 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 32
    :try_start_0
    new-instance v0, Ljava/io/File;

    invoke-direct {v0, p0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/io/File;->length()J

    move-result-wide v0

    const-wide v2, 0x80000000L

    cmp-long v4, v0, v2

    if-ltz v4, :cond_0

    return-void

    .line 33
    :cond_0
    new-instance v0, Ljava/util/zip/ZipFile;

    invoke-direct {v0, p0}, Ljava/util/zip/ZipFile;-><init>(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 34
    :try_start_1
    invoke-virtual {v0}, Ljava/util/zip/ZipFile;->close()V
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0

    :catch_0
    return-void

    :catchall_0
    move-exception p0

    goto :goto_0

    :catch_1
    move-exception p0

    .line 35
    :try_start_2
    invoke-virtual {p0}, Ljava/io/IOException;->getMessage()Ljava/lang/String;

    move-result-object v0

    if-eqz v0, :cond_2

    .line 36
    invoke-virtual {p0}, Ljava/io/IOException;->getMessage()Ljava/lang/String;

    move-result-object v0

    const-string v1, "Invalid General Purpose Bit Flag"

    invoke-virtual {v0, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_1

    .line 37
    invoke-virtual {p0}, Ljava/io/IOException;->getMessage()Ljava/lang/String;

    move-result-object v0

    const-string v1, "invalid CEN header (encrypted entry)"

    invoke-virtual {v0, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_2

    :cond_1
    return-void

    .line 38
    :cond_2
    throw p0
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    .line 39
    :goto_0
    throw p0
.end method

.method public static a([BI)Z
    .locals 2

    .line 40
    sget-object v0, Les/z70;->a:Lorg/apache/commons/compress/archivers/zip/ZipLong;

    invoke-virtual {v0}, Lorg/apache/commons/compress/archivers/zip/ZipLong;->getBytes()[B

    move-result-object v0

    array-length v0, v0

    const/4 v1, 0x0

    if-ge p1, v0, :cond_0

    return v1

    .line 41
    :cond_0
    sget-object p1, Les/z70;->a:Lorg/apache/commons/compress/archivers/zip/ZipLong;

    invoke-virtual {p1}, Lorg/apache/commons/compress/archivers/zip/ZipLong;->getBytes()[B

    move-result-object p1

    invoke-static {p0, p1}, Les/z70;->a([B[B)Z

    move-result p1

    if-nez p1, :cond_1

    sget-object p1, Les/z70;->b:[B

    .line 42
    invoke-static {p0, p1}, Les/z70;->a([B[B)Z

    move-result p0

    if-eqz p0, :cond_2

    :cond_1
    const/4 v1, 0x1

    :cond_2
    return v1
.end method

.method private static a([B[B)Z
    .locals 4

    const/4 v0, 0x0

    const/4 v1, 0x0

    .line 43
    :goto_0
    array-length v2, p1

    if-ge v1, v2, :cond_1

    .line 44
    aget-byte v2, p0, v1

    aget-byte v3, p1, v1

    if-eq v2, v3, :cond_0

    return v0

    :cond_0
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    :cond_1
    const/4 p0, 0x1

    return p0
.end method

.method public static b(Ljava/lang/String;Ljava/util/Map;)Les/e80;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;)",
            "Les/e80;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const/4 v0, 0x0

    .line 1
    invoke-static {p0, p1, v0}, Les/z70;->a(Ljava/lang/String;Ljava/util/Map;Ljava/lang/String;)Les/e80;

    move-result-object p0

    return-object p0
.end method

.method static b(Ljava/lang/String;)Z
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const/16 v0, 0xc

    new-array v0, v0, [B

    const/4 v1, 0x0

    .line 2
    :try_start_0
    new-instance v2, Ljava/io/FileInputStream;

    invoke-direct {v2, p0}, Ljava/io/FileInputStream;-><init>(Ljava/lang/String;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    .line 3
    :try_start_1
    invoke-virtual {v2, v0}, Ljava/io/InputStream;->read([B)I

    move-result p0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 4
    invoke-virtual {v2}, Ljava/io/InputStream;->close()V

    .line 5
    invoke-static {v0, p0}, Les/z70;->a([BI)Z

    move-result p0

    return p0

    :catchall_0
    move-exception p0

    move-object v1, v2

    goto :goto_0

    :catchall_1
    move-exception p0

    :goto_0
    if-eqz v1, :cond_0

    .line 6
    invoke-virtual {v1}, Ljava/io/InputStream;->close()V

    .line 7
    :cond_0
    throw p0
.end method
